package com.chaos.auth.config.userdetails.base;

import com.chaos.auth.config.exception.AliOpenIdNotFoundException;
import com.chaos.auth.config.exception.PhoneNotFoundException;
import com.chaos.auth.config.exception.WxOpenIdNotFoundException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

public interface UserDetailsExtService extends UserDetailsService {

    default UserDetails loadUserByUsername(String username, Long tenantId) throws UsernameNotFoundException {
        throw new UsernameNotFoundException("username not found");
    }

    default UserDetails loadUserByPhone(String phone, Long tenantId) throws PhoneNotFoundException {
        throw new PhoneNotFoundException("phone not found");
    }

    default UserDetails loadUserByWxOpenId(String wxOpenId, Long tenantId) throws WxOpenIdNotFoundException {
        throw new WxOpenIdNotFoundException("wxOpenId not found");
    }

    default UserDetails loadUserByAliOpenId(String aliOpenId, Long tenantId) throws AliOpenIdNotFoundException {
        throw new AliOpenIdNotFoundException("aliOpenId not found");
    }

    default UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        throw new UsernameNotFoundException("username not found");
    }


}